(byte-optimize-featurep): New.
authorDave Love <fx@gnu.org>
Thu, 12 Dec 2002 20:28:19 +0000 (20:28 +0000)
committerDave Love <fx@gnu.org>
Thu, 12 Dec 2002 20:28:19 +0000 (20:28 +0000)
lisp/emacs-lisp/byte-opt.el

index 3edc619ea3663845158544012cea2d9ec849a659..2e29e467d925595c12023dc314deca08d6b2cf1d 100644 (file)
 (defun byte-inline-lapcode (lap)
   (setq byte-compile-output (nconc (nreverse lap) byte-compile-output)))
 
-
 (defun byte-compile-inline-expand (form)
   (let* ((name (car form))
         (fn (or (cdr (assq name byte-compile-function-environment))
       form)))
 
 ;; Avoid having to write forward-... with a negative arg for speed.
+;; Fixme: don't be limited to constant args.
 (put 'backward-char 'byte-optimizer 'byte-optimize-backward-char)
 (defun byte-optimize-backward-char (form)
   (cond ((and (= 2 (safe-length form))
        ((= 1 (safe-length form))
         '(char-after (1- (point))))
        (t form)))
+
+;; Fixme: delete-char -> delete-region (byte-coded)
+;; optimize string-as-unibyte, string-as-multibyte, string-make-unibyte,
+;; string-make-multibyte for constant args.
+
+(put 'featurep 'byte-optimizer 'byte-optimize-featurep)
+(defun byte-optimize-featurep (form)
+  (if (equal '((quote xemacs)) (cdr-safe form))
+      nil
+    form))
 \f
 ;;; enumerating those functions which need not be called if the returned 
 ;;; value is not used.  That is, something like